﻿<Window x:Class="winCapEditor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:convertersT="clr-namespace:Tools.WindowsT.WPF.ConvertersT;assembly=Tools.Windows"
    Height="850" Width="1000"
    xmlns:my="clr-namespace:Caps.Console"
    Title="{Binding CapName, Mode=OneWay}" Icon="/CapsConsole;component/Resources/Cap.ico"
    FocusManager.FocusedElement="{Binding ElementName=caeEditor}"
>
    <Window.Resources>
        <convertersT:FunctionConverter x:Key="SelectionTypeConverter" Type="{x:Type my:winCapEditor}" Function="GetSelectionType"/>
        <convertersT:FunctionConverter x:Key="MattingGlossyConverter" Type="{x:Type my:winCapEditor}" Function="GetGlossy" FunctionBack="GetGlossyBack"/>
        <convertersT:IntColorConverter x:Key="IntColorConverter"/>
    </Window.Resources>
    
    <Grid>
        <my:CapEditor HorizontalAlignment="Stretch" VerticalAlignment="Center" x:Name="caeEditor"
                      
                      CapName="{Binding CapName, Mode=TwoWay}"              
                      MainText="{Binding MainText, Mode=TwoWay}"  
                      SubTitle="{Binding SubTitle, Mode=TwoWay}"
                      MainPicture="{Binding MainPicture, Mode=TwoWay}"
                      AnotherPictures="{Binding AnotherPictures, Mode=TwoWay}"
                      PictureType="{Binding PictureType, Mode=TwoWay}"
                      CapType="{Binding CapType, Mode=TwoWay}"
                      CapTypeSelection="{Binding CapType, Mode=OneWay, Converter={StaticResource SelectionTypeConverter}}"
                      CapMainType="{Binding MainType, Mode=TwoWay}"
                      CapShape="{Binding Shape, Mode=TwoWay}"
                      Size1="{Binding Size, Mode=TwoWay}"
                      Size2="{Binding Size2, Mode=TwoWay}"
                      CapHeight="{Binding Height, Mode=TwoWay}"
                      Material="{Binding Material, Mode=TwoWay}"
                      CapBackgroundColor1="{Binding BackColor1, Mode=TwoWay, Converter={StaticResource IntColorConverter}}"
                      CapBackgroundColor2="{Binding BackColor2, Mode=TwoWay, Converter={StaticResource IntColorConverter}}"
                      CapForegroundColor1="{Binding ForeColor, Mode=TwoWay, Converter={StaticResource IntColorConverter}}"
                      CapForegroundColor2="{Binding ForeColor2, Mode=TwoWay, Converter={StaticResource IntColorConverter}}"
                      Is3D="{Binding Is3D, Mode=TwoWay}"
                      IsGlossy="{Binding Surface, Converter={StaticResource MattingGlossyConverter}, Mode=TwoWay}"
                      TopText="{Binding TopText, Mode=TwoWay}"
                      SideText="{Binding SideText, Mode=TwoWay}"
                      BottomText="{Binding BottomText, Mode=TwoWay}"
                      CapNote="{Binding Note, Mode=TwoWay}"
                      CapID="{Binding CapID, Mode=OneWay}"
                      Year="{Binding Year, Mode=TwoWay}"
                      Country="{Binding CountryCode, Mode=TwoWay}"
                      Storage="{Binding Storage, Mode=TwoWay}"
                      HasBottom="{Binding HasBottom, Mode=TwoWay}"
                      HasSide="{Binding HasSide, Mode=TwoWay}"
                      Product="{Binding Product, Mode=TwoWay}"
                      ProductSelection="{Binding Product, Mode=OneWay, Converter={StaticResource SelectionTypeConverter}}"
                      CapProductType="{Binding ProductType, Mode=TwoWay}"
                      CapCompany="{Binding Company, Mode=TwoWay}"
                      CountryOfOrigin="{Binding CountryOfOrigin, Mode=TwoWay}"
                      IsDrink="{Binding IsDrink, Mode=TwoWay}"
                      State="{Binding State, Mode=TwoWay}"
                      Target="{Binding Target, Mode=TwoWay}"
                      IsAlcoholic="{Binding IsAlcoholic, Mode=TwoWay}"
                                          
                      AllowSearch="False"
                      IsSplitButtonVisible="True"
                      EnabledCommands="SaveAndClose,SaveAndNext,SaveAndPrevious,SaveAndNew,PreviousNoSave,NextNoSave,Reset"
        />
    </Grid>
</Window>
